#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
    char a = 0;
    int count1 = 0;
    int count2 = 0;
    while((a = getchar()) != '0')
    {
        if(a == 'A')
            count1++;
       else
            count2++;
    }
    if(count1 > count2)
        printf("A");
    else if(count1 < count2)
        printf("B");
    else
        printf("E");
    return 0;
}

